They have stinging cells in their tentacles that allows them to paralyze their prey—usually small fish, or shrimp—and then move them towards their mouth.
The stinging cells in the tentacles release a harpoon of venom that stabs their prey and injects venom which paralyzes them and they can begin to consume that prey.
Plus, corals are related to anemones and jellyfish, and the fleshy polyps have nasty stinging cells called , which resemble tiny harpoons that spear prey or potential attackers and can inject chemicals.